#include "iostream"
#include "stdio.h"
#include "string.h"
#include <stdlib.h>
#include "stdio.h"

void my_strncpy(char* dst,char* src,int n){
	for(int t = 0; t < n;t++) {
		dst[t] = src[t];
	}
}

void str_inter(char* src_str, int src_inter_len,char* out_str, char* inter_str) {
	char* str;
	int pos = 0, inter_str_size=strlen(inter_str), src_len=strlen(src_str),loop = src_len / src_inter_len;
	if (src_len % src_inter_len != 0)
		loop++;

	for (int t = 0; t <loop; t++) {
		my_strncpy(&out_str[pos], &src_str[src_inter_len * t], src_inter_len);				//TODO
		pos += src_inter_len;
		//if (t < loop -1) {
			my_strncpy(&out_str[pos], inter_str, inter_str_size);
			pos += inter_str_size;
		//}
	}
	out_str[pos - 1] = 0;
//	out_str[pos] = 0;

}


int  main(){

	char tmp[100];
	my_strncpy(tmp, (char*)"AT+DEI=", strlen("AT+DEI="));
	const char str[] = "0009000019700002571300090000197000025713";
	str_inter((char*)str,2,&tmp[strlen("AT+DEI=")],(char*)":");


	printf("%s\n",tmp);
	while (1);
	return 0;
}